package main.flex.business.responder
{
	import main.flex.control.MainController;
	
	import main.flex.model.MainModel;
	
	import mx.controls.Alert;
	import mx.rpc.events.FaultEvent;
	
	import org.servebox.foundry.model.ModelLocator;
	import org.servebox.foundry.service.IBusinessResponder;

	public class MainBaseResponder implements IBusinessResponder
	{
		public function result(data:Object):void
		{
			// MUST BE OVERRIDEN
		}
		
		public function fault(info:Object):void
		{
			// A really simple error managment
			Alert.show("" + FaultEvent( info ).message );
		}
		
		/**
	      * Return reference to the application model
	      */
		protected function getMainModel() : MainModel
		{
			return MainModel (
				ModelLocator.getInstance().getModel( MainController.MAIN_MODEL_ID )
			);
		}
	}
}